
public class LargestSubsequence {
	public String getLargest(String s) {
		int idx = -1;
		StringBuilder res = new StringBuilder(50);
		cycle: while (idx != s.length()-1) {
			for (char c = 'z'; c>='a'; c--) {
				int x = s.indexOf(c, idx+1);
				if (x >= 0) {
					res.append(s.charAt(x));
					idx = x;
					continue cycle;
				}
			}
		}	
		return res.toString();
	}
}
